﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using VNet.VisiSuite.Controls;
using VNet.VisiSuite.VisiCentral.Common.Helpers;
using VNet.VisiSuite.VisiCentral.Controls;
using VNet.VisiSuite.VisiCentral.ViewModels;

namespace VNet.VisiSuite.VisiCentral.Views
{
    public partial class LoginView : VisiPage
    {
        public LoginView()
        {
            InitializeComponent();
        }

        private void OnEnterKeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Return)
            {
                var viewModel = DataContext as LoginViewModel;
                if (viewModel != null && viewModel.LoginCommand != null)
                    viewModel.LoginCommand.Execute(null);
            }
        }

        private void VisiPage_Loaded(object sender, RoutedEventArgs e)
        {
            _userNameTxt.Focus();
        }
    }
}
